from flask import Flask,make_response,request

app = Flask(__name__)

@app.route('/')
def index():
    return 'Hello'

@app.route('/set_cookie/')
def set_cookie():
    resp = make_response('设置了cookie信息')
    resp.set_cookie('uname','itbaizhan')
    return resp

@app.route('/get_cookie/')
def get_cookie():
    uname = request.cookies.get('uname')
    return 'uname的值是：%s' % uname

@app.route('/del_cookie/')
def del_cookie():
    resp = make_response('删除了cookie信息')
    resp.delete_cookie('uname')
    return resp

if __name__ == '__main__':
    app.run(debug=True)